//
//  BaseViewController.h
//  Student
//
//  Created by 马腾飞 on 15/9/8.
//  Copyright (c) 2015年 XueYinYue. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MTStatusBarOverlay.h"

@class EACBizService;
@class EACService;

@interface BaseViewController : UIViewController <MTStatusBarOverlayDelegate, UIAlertViewDelegate, UITextFieldDelegate>

@property(nonatomic, strong) UIBarButtonItem *backBarButtonItem;
@property(nonatomic, weak) void (^alertViewOkBlock)();
@property(nonatomic, weak) void (^alertViewCancelBlock)();

- (void)showToastMessage:(NSString *)message;

- (void)showAlertMessage:(NSString *)message;

- (void)showAlertTitle:(NSString *)title withMessage:(NSString *)message;

- (void)showAlertMessage:(NSString *)message withOKHandler:(void (^)(void))okHandler andCancelHandler:(void (^)(void))cancelHandler;

- (void)showStatusBarMessage:(NSString *)message;

- (void)showProgressView;

- (void)showProgressViewWithMessage:(NSString *)message;

- (void)showProgressViewInWindowDelayWithMessage:(NSString *)message;

- (void)showProgressViewInWindowWithMessage:(NSString *)message;

- (void)showProgressViewWithPlainTextInWindowWithMessage:(NSString *)message;

- (void)hideProgressView;

- (void)hideProgressViewInWindow;

- (void)hideBackBarButtonItem;

- (void)backBarButtonItemOnClick:(id)sender;

- (void)processNotification:(NSNotification *)notification;

- (void)addObserverNotification:(NSString *)name;

#pragma mark - Run Service

- (void)runService:(EACService *)service andComplete:(void (^)(EACService *))onComplete andSuccess:(void (^)(EACService *, id))onSuccess andFault:(void (^)(EACService *, NSException *))onFault;

- (void)runService:(EACService *)service andComplete:(void (^)(EACService *))onComplete andSuccess:(void (^)(EACService *, id))onSuccess;

- (void)runService:(EACService *)service andComplete:(void (^)(EACService *))onComplete;

- (void)runService:(EACService *)service;


@end

